package com.jmag.nop.service.common.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jmag.nop.service.common.api.ApiMeta;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * @ClassName ApiInterceptorAdapter
 * @Description 拦截器，原理同springmvc拦截器
 * @Author JMAG
 * @Version 1.0
 **/
public abstract class ApiInterceptorAdapter implements ApiInterceptor {
    protected Logger logger = LoggerFactory.getLogger(this.getClass());

    public ApiInterceptorAdapter() {
    }

    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object serviceObj, Object argu) throws Exception {
        return true;
    }

    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object serviceObj, Object argu, Object result) throws Exception {
    }

    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object serviceObj, Object argu, Object result, Exception e) throws Exception {
    }

    public boolean match(ApiMeta apiMeta) {
        return true;
    }
}
